package com.yiyuan.app.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.guaike.core.mybatis.plugins.BaseDAO;
import com.yiyuan.app.entity.po.MRecordProductCardPO;
import com.yiyuan.app.mapper.MRecordProductCardMapper;
import org.springframework.stereotype.Repository;

@Repository
public class MRecordProductCardDAO extends BaseDAO<MRecordProductCardMapper, MRecordProductCardPO> {

    public MRecordProductCardPO findUserCardByCardId(Long userId, Long cardId) {
        LambdaQueryWrapper<MRecordProductCardPO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(MRecordProductCardPO::getUserId, userId);
        queryWrapper.eq(MRecordProductCardPO::getCardId, cardId);
        return getBaseMapper().selectOne(queryWrapper);
    }
}
